import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'
import Page from '../views/Component.vue'
import PageWrap from '../views/ComponentWrap.vue'

export const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/mayor',
    name: 'Mayor',
    component: PageWrap,
    redirect: '/mayor/datastruct',
    meta: {
      title: '计算机专业课'
    },
    children: [
      {
        path: 'datastruct',
        name: 'MayorDataStruct',
        component: Page,
        redirect: '/mayor/datastruct/no1',
        meta: {
          title: '数据结构和算法'
        },
        children: [
          {
            path: 'no1',
            name: 'MayorDataStruct1',
            component: () => import('../docs/mayor_dataStruct_1.md'),
            meta: {
              title: '数据结构大作业'
            }
          },
          {
            path: 'no2',
            name: 'MayorDataStruct2',
            component: () => import('../docs/mayor_dataStruct_2.md'),
            meta: {
              title: '数据结构第二节'
            }
          },
          {
            path: 'no3',
            name: 'MayorDataStruct3',
            component: () => import('../docs/mayor_dataStruct_3.md'),
            meta: {
              title: '数据结构第三节'
            }
          },
          {
            path: 'no4',
            name: 'MayorDataStruct4',
            component: () => import('../docs/mayor_dataStruct_4.md'),
            meta: {
              title: '数据结构第四节'
            }
          },
          {
            path: 'no5',
            name: 'MayorDataStruct5',
            component: () => import('../docs/mayor_dataStruct_5.md'),
            meta: {
              title: '数据结构第五节'
            }
          }
        ]
      },
      {
        path: 'computecomb',
        name: 'MayorCompcomb',
        component: Page,
        redirect: '/mayor/computecomb/no1',
        meta: {
          title: '计算机组成原理'
        },
        children: [
          {
            path: 'no1',
            name: 'MayorCompcomb1',
            component: () => import('../docs/mayor_computecomb_1.md'),
            meta: {
              title: '计算机组成原理第一节'
            }
          },
          {
            path: 'no2',
            name: 'MayorCompcomb2',
            component: () => import('../docs/mayor_computecomb_2.md'),
            meta: {
              title: '计算机组成原理第二节'
            }
          },
          {
            path: 'no3',
            name: 'MayorCompcomb3',
            component: () => import('../docs/mayor_computecomb_3.md'),
            meta: {
              title: '计算机组成原理第三节'
            }
          },
          {
            path: 'no4',
            name: 'MayorCompcomb4',
            component: () => import('../docs/mayor_computecomb_4.md'),
            meta: {
              title: '计算机组成原理第四节'
            }
          },
          {
            path: 'no5',
            name: 'MayorCompcomb5',
            component: () => import('../docs/mayor_computecomb_5.md'),
            meta: {
              title: '计算机组成原理第五节'
            }
          }
        ]
      },
      {
        path: 'clang',
        name: 'MayorClang',
        component: Page,
        redirect: '/mayor/clang/no1',
        meta: {
          title: 'C语言'
        },
        children: [
          {
            path: 'no1',
            name: 'MayorClang1',
            component: () => import('../docs/mayor_clang_1.md'),
            meta: {
              title: 'C语言第一节'
            }
          },
          {
            path: 'no2',
            name: 'MayorClang2',
            component: () => import('../docs/mayor_clang_2.md'),
            meta: {
              title: 'C语言第二节'
            }
          },
          {
            path: 'no3',
            name: 'MayorClang3',
            component: () => import('../docs/mayor_clang_3.md'),
            meta: {
              title: 'C语言第三节'
            }
          },
          {
            path: 'no4',
            name: 'MayorClang4',
            component: () => import('../docs/mayor_clang_4.md'),
            meta: {
              title: 'C语言第四节'
            }
          },
          {
            path: 'no5',
            name: 'MayorClang5',
            component: () => import('../docs/mayor_clang_5.md'),
            meta: {
              title: 'C语言第五节'
            }
          }
        ]
      },
      {
        path: 'collegeenglish',
        name: 'MayorCollEng',
        component: Page,
        redirect: '/mayor/collegeenglish/no1',
        meta: {
          title: '大学英语'
        },
        children: [
          {
            path: 'no1',
            name: 'MayorCollEng1',
            component: () => import('../docs/mayor_collegeenglish_1.md'),
            meta: {
              title: '三级英语概述'
            }
          },
          {
            path: 'no2',
            name: 'MayorCollEng2',
            component: () => import('../docs/mayor_collegeenglish_2.md'),
            meta: {
              title: '阅读理解-01'
            }
          },
          {
            path: 'no3',
            name: 'MayorCollEng3',
            component: () => import('../docs/mayor_collegeenglish_3.md'),
            meta: {
              title: '阅读理解-02'
            }
          },
          {
            path: 'no4',
            name: 'MayorCollEng4',
            component: () => import('../docs/mayor_collegeenglish_4.md'),
            meta: {
              title: '阅读理解-03'
            }
          },
          {
            path: 'no5',
            name: 'MayorCollEng5',
            component: () => import('../docs/mayor_collegeenglish_5.md'),
            meta: {
              title: '阅读理解-04'
            }
          }
        ]
      },
      {
        path: 'maotheory',
        name: 'MayorMaotheory',
        component: Page,
        redirect: '/mayor/maotheory/no1',
        meta: {
          title: '毛泽东理论概述'
        },
        children: [
          {
            path: 'no1',
            name: 'MayorMaotheory1',
            component: () => import('../docs/mayor_maotheory_1.md'),
            meta: {
              title: '期末大作业'
            }
          },
          {
            path: 'no2',
            name: 'MayorMaotheory2',
            component: () => import('../docs/mayor_maotheory_2.md'),
            meta: {
              title: '毛泽东理论概述第二节'
            }
          },
          {
            path: 'no3',
            name: 'MayorMaotheory3',
            component: () => import('../docs/mayor_maotheory_3.md'),
            meta: {
              title: '毛泽东理论概述第三节'
            }
          },
          {
            path: 'no4',
            name: 'MayorMaotheory4',
            component: () => import('../docs/mayor_maotheory_4.md'),
            meta: {
              title: '毛泽东理论概述第四节'
            }
          },
          {
            path: 'no5',
            name: 'MayorMaotheory5',
            component: () => import('../docs/mayor_maotheory_5.md'),
            meta: {
              title: '毛泽东理论概述第五节'
            }
          }
        ]
      }
    ]
  },
  {
    path: '/language',
    name: 'Language',
    component: PageWrap,
    redirect: '/language/js',
    meta: {
      title: '编程语言'
    },
    children: [
      {
        path: 'js',
        name: 'LangJs',
        component: Page,
        redirect: '/language/js/no1',
        meta: {
          title: 'Javascript'
        },
        children: [
          {
            path: 'no1',
            name: 'LangJs1',
            component: () => import('../docs/lang_js_1.md'),
            meta: {
              title: '神奇的Promise'
            }
          },
          {
            path: 'no2',
            name: 'LangJs2',
            component: () => import('../docs/lang_js_2.md'),
            meta: {
              title: '神奇的reduce'
            }
          },
          {
            path: 'no3',
            name: 'LangJs3',
            component: () => import('../docs/lang_js_3.md'),
            meta: {
              title: 'Javascript第三节'
            }
          },
          {
            path: 'no4',
            name: 'LangJs4',
            component: () => import('../docs/lang_js_4.md'),
            meta: {
              title: 'Javascript第四节'
            }
          },
          {
            path: 'no5',
            name: 'LangJs5',
            component: () => import('../docs/lang_js_5.md'),
            meta: {
              title: 'Javascript第五节'
            }
          }
        ]
      }
    ]
  },
  {
    path: '/showtime',
    name: 'Showtime',
    component: PageWrap,
    redirect: '/showtime/index',
    meta: {
      title: 'showtime'
    },
    children: [
      {
        path: 'index',
        name: 'ShowtimeIndex',
        component: () => import('../docs/showtime_01.md'),
        meta: {
          title: 'showtime'
        }
      }
    ]
  },
  {
    path: '/books',
    name: 'Books',
    component: PageWrap,
    redirect: '/books/ddj',
    meta: {
      title: '文学书籍'
    },
    children: [
      {
        path: 'ddj',
        name: 'BkDdj',
        component: Page,
        redirect: '/books/ddj/no1',
        children: [
          {
            path: 'no1',
            name: 'BkDdj1',
            component: () => import('../docs/books_ddj_1.md'),
            meta: {
              title: '第一章 天地之始 万物之母'
            }
          },
          {
            path: 'no2',
            name: 'BkDdj2',
            component: () => import('../docs/books_ddj_2.md'),
            meta: {
              title: '第二章 为而不恃 功成弗居'
            }
          },
          {
            path: 'no3',
            name: 'BkDdj3',
            component: () => import('../docs/books_ddj_3.md'),
            meta: {
              title: '第三章 圣人之道 无为之道'
            }
          },
          {
            path: 'no4',
            name: 'BkDdj4',
            component: () => import('../docs/books_ddj_4.md'),
            meta: {
              title: '第四章 挫锐解纷 和光同尘'
            }
          },
          {
            path: 'no5',
            name: 'BkDdj5',
            component: () => import('../docs/books_ddj_5.md'),
            meta: {
              title: '第五章 多言数穷 不如守中'
            }
          }
        ],
        meta: {
          title: '道德经'
        }
      }
    ]
  },
  {
    path: '/demo',
    name: 'Demo',
    component: PageWrap,
    redirect: '/demo/markdown-demo',
    meta: {
      title: 'Demo'
    },
    children: [
      {
        path: 'markdown-demo',
        name: 'DemoMd',
        component: () => import('../docs/demo.md'),
        meta: {
          title: 'markdown demo'
        }
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
